
fun GCD(x, y) = 
  if y = 0 then x
  else GCD(y, x mod y);
  
 